/*
 * @Author: daidai
 * @Date: 2021-12-23 11:18:37
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2022-04-28 15:10:45
 * @FilePath: \web-pc\src\api\modules\index.js
 */
import * as API from "../api";

export const paramType = {
  //////////////////////////////////登陆页面
  login: "/user/login/app/phone",
  currentUser: "/user/login/account/current",
  loginout: "/app/user/login/out",

  ///////////////////////////////////////////首页

  leftTopPieHome: "/cockpit/leader/article/channel/pie", //渠道统计
  leftTopArticleHome: "/cockpit/leader/article/page", //最新报道

  leftBottomPieTopicHome: "/cockpit/plan/topic/type/pie", //重点选题
  leftBottomPieSubmitHome: "/cockpit/plan/clue/organizationType/pie", //新闻线索
  leftBottomListHome: "/cockpit/plan/topic/page", //融媒体中心
  leftBottomListmainHome: "/cockpit/xtbs/topic/page", //市委宣传部

  centerTopTotalHome: "/cockpit/impact/engagement", //阅读量，点赞量，转发量
  centerBottomTurntablelHome: "/cockpit/impact/source/article", //账号发稿情况

  rightTopTrendHome: "/cockpit/article/months/line", //外宣趋势
  rightTopArticleHome: "/cockpit/article/page", //媒体报道

  rightBottomRankHome: "/cockpit/impact/source/summary", //传播质效

  /////////////////////////////////////////////////传播质效页面

  CenterSummaryAssess: "/cockpit/impact/source/summary", //总量

  centerAnalysisEngagementAssess: "/cockpit/impact/engagement", //三角形的统计（传播参与度）
  centerAnalysisRanklineAssess: "/cockpit/impact/source/rank/line", //总排名趋势（）
  centerAnalysisArticlelineAssess: "/cockpit/impact/source/article/line", //发稿量变化趋势
  centerAnalysisEngagementlineAssess:"/cockpit/impact/source/article/engagement/line", //交互量变化趋势

  /////////////////////////////////////////////////////选题策划页面
  leftTopIndustryPieClues:"/cockpit/plan/industry/pie",//类型分析
  leftTopOrganizationNamePieClues:"/cockpit/plan/clue/organizationName/pie",//线索报送量

  leftBottomClueListClues:"/cockpit/plan/topic/page",//最新线索

  centerTopTotalClues:"/cockpit/plan/clue/summary",//全年线索
  centerCenterClues:"/cockpit/hotspot",//热搜热榜

  rightTopTopicLineClues:"/cockpit/plan/topic/months/line",//近半年选题发布趋势
  rightTopTopicListClues:"/cockpit/plan/topic/page",//最新发布选题

  rightBottomMeterialClues:"/cockpit/material/page",//最新素材
};
/******************      通用增删改查       ********************* */
/**
 * 通用列表
 * @param {*} param
 */
export const currentList = (key, param) => {
  return API.GET(paramType[key] + "/list", param);
};
export const currentPage = (key, param) => {
  return API.GET(paramType[key] + "/page", param);
};
/**
 * 查询可选择的列表
 * @param {*} param
 */
export const currentSelectList = (key, param) => {
  return API.GET(paramType[key] + "/selectList", param);
};

/**
 * 通用新增
 * @param {*} param
 */
export const currentSave = (key, param) => {
  return API.POST(paramType[key] + "/save", param);
};
/**
 * 通用修改
 * @param {*} param
 */
export const currentUpdate = (key, param) => {
  return API.POST(paramType[key] + "/update", param);
};

/**
 * 通用删除
 * @param {*} param
 */
export const currentDelete = (key, param) => {
  return API.POST(paramType[key] + "/delete", param);
};

/**
 * 通用获取所有不分页
 * @param {*} param
 */
export const currentSelect = (key, param) => {
  return API.GET(paramType[key] + "/select", param);
};

/**
 * 通用GET
 * @param {*} param
 */
export const currentGET = (key, param) => {
  return API.GET(paramType[key], param);
};
/**
 * 通用POST
 * @param {*} param
 */
export const currentPOST = (key, param) => {
  return API.POST(paramType[key], param);
};
// 通用接口集合
export const currentApi = {
  currentList,
  currentPage,
  currentSave,
  currentUpdate,
  currentDelete,
  currentSelect,
  currentSelectList,
  currentPOST,
};
